import Layout from '@/layout'

export default [
  {
    path: '/',
    component: Layout,
    redirect: '/welcome',
    children: [
      {
        path: 'welcome',
        name: '首页',
        meta: { title: '首页' },
        component: () => import('@/views/welcome'),
        hidden: true
      }
    ]
  },

  {
    path: '/user',
    component: Layout,
    meta: { title: '用户管理', icon: 'el-icon-s-custom' },
    redirect: 'noRedirect',
    alwaysShow: true,
    children: [
      {
        path: '',
        name: 'User',
        component: () => import('@/views/User'),
        meta: { title: '用户列表', icon: 'el-icon-menu' }
      }
    ]
  },

  {
    path: '/roles',
    component: Layout,
    redirect: 'noRedirect',
    meta: { title: '权限管理', icon: 'el-icon-cpu' },
    children: [
      {
        path: '',
        name: 'Roles',
        component: () => import('@/views/Roles/index'),
        meta: { title: '角色列表', icon: 'el-icon-menu' }
      },
      {
        path: '/rights',
        name: 'Rights',
        component: () => import('@/views/Rights/index'),
        meta: { title: '权限列表', icon: 'el-icon-menu' }
      }
    ]
  },

  {
    path: '/goods',
    component: Layout,
    redirect: 'noRedirect',
    meta: { title: '商品管理', icon: 'el-icon-shopping-bag-1' },
    children: [
      {
        path: '',
        name: 'Goods',
        component: () => import('@/views/Goods/index'),
        meta: { title: '商品列表', icon: 'el-icon-menu' }
      },
      {
        path: '/params',
        name: 'Params',
        component: () => import('@/views/Params/index'),
        meta: { title: '分类参数', icon: 'el-icon-menu' }
      },
      {
        path: '/categories',
        name: 'Categories',
        component: () => import('@/views/Categories/index'),
        meta: { title: '商品分类', icon: 'el-icon-menu' }
      },
      {
        path: 'add',
        name: 'AddGoods',
        component: () => import('@/views/Goods/AddGoods/index'),
        meta: { title: '添加商品' },
        hidden: true
      }
    ]
  },

  {
    path: '/orders',
    component: Layout,
    redirect: 'noRedirect',
    alwaysShow: true,
    meta: { title: '订单管理', icon: 'el-icon-notebook-1' },
    children: [
      {
        path: '',
        name: 'Orders',
        component: () => import('@/views/Orders/index'),
        meta: { title: '订单列表', icon: 'el-icon-menu' }
      }
    ]
  },

  {
    path: '/reports',
    component: Layout,
    redirect: 'noRedirect',
    alwaysShow: true,
    meta: { title: '数据统计', icon: 'el-icon-monitor' },

    children: [
      {
        path: '',
        name: 'Reports',
        component: () => import('@/views/Reports'),
        meta: { title: '数据报表', icon: 'el-icon-menu' }
      }
    ]
  }
]
